/**
 * 
 */
package fachkonzept;
import java.util.TreeMap;
import util.Car;

/**
 * @author Sebastian
 *
 */
@SuppressWarnings("serial")
public class CarResult extends TreeMap<String,Car> {
	/**
	 * fills the extended treemap with an array of cars
	 * @param cars the cars to be filled in the result
	 */
	synchronized void fill(Car[] cars){
		
		this.clear();
		
		for(Car theCar : cars){
			
			this.put(theCar.getIdentificationNumber(), theCar);
		}
	}
	/**
	 * returns Car determined by the identification number
	 * @param identificationNumber the identification for the desired car
	 */
	@Override
	public synchronized Car get(Object identificationNumber){
		
		return super.get(identificationNumber);
	}
	/**
	 * erases all Cars in the result
	 */
	public synchronized void clear(){
		
		super.clear();
	}
}
